﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace oreimou
{
    class Program
    {
        static void Main(string[] args)
        {
            //Exract();
            Pack();
        }

        private static void Pack()
        {
            string root = @"E:\game\test\oreimou";
            string folder = @"\root";
            string filepath = root + @"\res_new.dat";
            FileContent fc = new FileContent(filepath, System.IO.FileAccess.Write);
            Pgpda rootnode = new Pgpda(fc, 0, -1, "root");
            rootnode.GetItemsDir(new System.IO.DirectoryInfo(root + folder));
        }

        private static void Exract()
        {
            string root = @"E:\game\test\oreimou";
            string folder = @"\";
            string filepath = root + folder + "RES_new.DAT";
            FileContent fc = new FileContent(filepath,System.IO.FileAccess.Read);
            Pgpda rootnode = new Pgpda(fc, 0, -1, "root_new");
            rootnode.GetItems();
            rootnode.Exract(root + folder);
        }
    }
}
